using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class CellMgr : MonoBehaviour
{
    public GameObject _cell;
    public int _floorLen;
    public int _floorWidth;

    void Start()
    {
        GenCells();
    }

    void Update()
    {

    }

    private void GenCells()
    {
        transform.localScale = new Vector3(((float)_floorLen) / 10, 1, ((float)_floorWidth) / 10);

        for (int i = 0; i < _floorLen; i++)
        {
            for (int j = 0; j < _floorWidth; j++)
            {
                int x = i - _floorLen / 2;
                int z = j - _floorWidth / 2;
                GameObject cell = Instantiate(_cell, new Vector3(x, 0, z), _cell.transform.rotation);
                cell.transform.parent = transform;
            }
        }
    }
}
